package br.com.santana.route.webservice;

import javax.ejb.Stateless;
import javax.jws.WebMethod;
import javax.jws.WebParam;
import javax.jws.WebResult;
import javax.jws.WebService;
import javax.jws.soap.SOAPBinding;
import javax.jws.soap.SOAPBinding.Style;
import javax.jws.soap.SOAPBinding.Use;

import org.jboss.wsf.spi.annotation.WebContext;

import br.com.maplink2.webservices.Address;
import br.com.maplink2.webservices.Point;
import br.com.santana.route.IRoute;
import br.com.santana.route.RouteImpl;
import br.com.santana.route.to.RouteTO;

@WebService
@Stateless
@SOAPBinding(style = Style.RPC, use = Use.LITERAL)
@WebContext(contextRoot = "/route-ws", urlPattern = "/RouteWS", transportGuarantee = "NONE", secureWSDLAccess = false)
public class RouteWS {
	
	private IRoute iRoute = new RouteImpl();
	
	@WebMethod(operationName = "getCoordinatesByAddress")
	public @WebResult(name= "result") Point getCoordinatesByAddress(@WebParam(name = "address") Address address) {
		return iRoute.getCoordinatesByAddress(address);
	}
	
	@WebMethod(operationName = "getRouteValues")
	public @WebResult(name= "result") RouteTO getRouteValues(@WebParam(name = "routeTO") RouteTO routeTO) {
		return iRoute.getRouteValues(routeTO);
	}

}
